import scipy.io as scio
import numpy as np
import pylab as pl
dataFile = '../clips/Patient_6/Patient_6_interictal_segment_21.mat';
data = scio.loadmat(dataFile);
#time domain data
x = [num for num in range(5000)];
#print x
y = data['data'][0];
pl.plot(x,y)
pl.title('EEG Time Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Sampling Times')
pl.show()



#frequency data
fft = np.fft.rfft(y)
fft = np.abs(fft)
print fft.shape

x2 = [num for num in range(2501)];
#print x
pl.plot(x2,fft)
pl.ylim([0,70000])
pl.title('EEG Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()

#0~120hz
fft=fft[:120]
x2 = [num for num in range(120)];
#print x
pl.plot(x2,fft)
pl.ylim([0,140000])
pl.title('1-120Hz Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()



####################
dataFile = '../clips/Patient_6/Patient_6_interictal_segment_22.mat';
data = scio.loadmat(dataFile);
#time domain data
x = [num for num in range(5000)];
#print x
y = data['data'][0];
pl.plot(x,y)
pl.title('EEG Time Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Sampling Times')
pl.show()



#frequency data
fft = np.fft.rfft(y)
fft = np.abs(fft)
print fft.shape

x2 = [num for num in range(2501)];
#print x
pl.plot(x2,fft)
pl.ylim([0,70000])
pl.title('EEG Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()

#0~120hz
fft=fft[:120]
x2 = [num for num in range(120)];
#print x
pl.plot(x2,fft)
pl.ylim([0,140000])
pl.title('1-120Hz Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()




##############
dataFile = '../clips/Patient_6/Patient_6_interictal_segment_23.mat';
data = scio.loadmat(dataFile);
#time domain data
x = [num for num in range(5000)];
#print x
y = data['data'][0];
pl.plot(x,y)
pl.title('EEG Time Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Sampling Times')
pl.show()



#frequency data
fft = np.fft.rfft(y)
fft = np.abs(fft)
print fft.shape

x2 = [num for num in range(2501)];
#print x
pl.plot(x2,fft)
pl.ylim([0,70000])
pl.title('EEG Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()

#0~120hz
fft=fft[:120]
x2 = [num for num in range(120)];
#print x
pl.plot(x2,fft)
pl.ylim([0,140000])
pl.title('1-120Hz Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()



#######################
dataFile = '../clips/Patient_6/Patient_6_ictal_segment_23.mat';
data = scio.loadmat(dataFile);
#time domain data
x = [num for num in range(5000)];
#print x
y = data['data'][0];
pl.plot(x,y)
pl.title('EEG Time Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Sampling Times')
pl.show()



#frequency data
fft = np.fft.rfft(y)
fft = np.abs(fft)
print fft.shape

x2 = [num for num in range(2501)];
#print x
pl.plot(x2,fft)
pl.ylim([0,70000])
pl.title('EEG Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()

#0~120hz
fft=fft[:120]
x2 = [num for num in range(120)];
#print x
pl.plot(x2,fft)
pl.ylim([0,140000])
pl.title('1-120Hz Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()





##################
dataFile = '../clips/Patient_6/Patient_6_ictal_segment_24.mat';
data = scio.loadmat(dataFile);
#time domain data
x = [num for num in range(5000)];
#print x
y = data['data'][0];
pl.plot(x,y)
pl.title('EEG Time Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Sampling Times')
pl.show()



#frequency data
fft = np.fft.rfft(y)
fft = np.abs(fft)
print fft.shape

x2 = [num for num in range(2501)];
#print x
pl.plot(x2,fft)
pl.ylim([0,70000])
pl.title('EEG Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()

#0~120hz
fft=fft[:120]
x2 = [num for num in range(120)];
#print x
pl.plot(x2,fft)
pl.ylim([0,140000])
pl.title('1-120Hz Frequency Domain Signal')
pl.ylabel('Amplitude Values')
pl.xlabel('Frequency(HZ)')
pl.show()